#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
    int money[13];
    for (int i = 0; i < 12; i++)
        scanf("%d", &money[i]);

    int J = 0;
    int mom = 0;
    int x;
    for (int i = 0; i < 12; i++)
    {
        J += 300;
        J -= money[i];
        while (J > 100)
        {
            J -= 100;
            mom += 100;
        }
        if (J < 0)
        {
            x = i + 1;
            printf("-%d", x);
            return 0;
        }
    }
    J += (mom * 1.2);
    printf("%d", J);
    return 0;
}